package com.cetccloud.ap.controller;

import com.cetccloud.ap.proxy.channel.cossDomain.s30.S30Adapter;
import com.thunisoft.exchange.gateway.protocol.entity.GatewayExchangeNode;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

import java.util.Collection;

/**
 * @ClassName S30Controller
 * @Description TODO
 * @Author superz
 * @Date 2021/4/24 20:21
 * @Version 1.0
 **/
@Slf4j
@RestController
@RequestMapping("/s30")
public class S30Controller {

    @Autowired
    private S30Adapter s30Adapter;

    @GetMapping("/meta")
    public Mono<Collection<GatewayExchangeNode>> meta() {
        log.info("/s30/meta");
        return Mono.justOrEmpty(s30Adapter.getProxyMeta());
    }
}
